<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>商户中心</title>


    <link href="__HOME__/center/css/bootstrap.min.css" rel="stylesheet">
    <link href="__HOME__/center/css/datepicker3.css" rel="stylesheet">
    <link href="__HOME__/center/css/styles.css" rel="stylesheet">
    <link href="__HOME__/center/css/InfoStyle.css" rel="stylesheet">
    <link href="__HOME__/center/css/fileinput.css" media="all" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="__HOME__/center/css/default.css">
    <!--[if lt IE 9]>
    <script src="__HOME__/center/js/html5shiv.js"></script>
    <script src="__HOME__/center/js/respond.min.js"></script>
    <![endif]-->

</head>

<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#sidebar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#"><span>Lumino</span>Admin</a>
            <ul class="user-menu">
                <li class="dropdown pull-right">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span
                            class="glyphicon glyphicon-user"></span> {$user_info.name} <span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="#"><span class="glyphicon glyphicon-user"></span> Profile</a></li>
                        <li><a href="#"><span class="glyphicon glyphicon-cog"></span> Settings</a></li>
                        <li><a href="{:url('shop/LoginOut/index')}"><span class="glyphicon glyphicon-log-out"></span>
                            Logout</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div><!-- /.container-fluid -->
</nav>

<div id="sidebar-collapse" class="col-sm-3 col-lg-2 sidebar">
    <form role="search">
    </form>
    <ul class="nav menu">
        <li {notempty name="class_index" }{$class_index}{/notempty}>
            <a href="{:url('shop/center/index')}"><span class="glyphicon glyphicon-dashboard"></span> 首页</a>
        </li>
        <li {notempty name="class_photo" }{$class_photo}{/notempty} >
            <a href="{:url('shop/photos/index')}"><span class="glyphicon glyphicon-th"></span> 相册</a>
        </li>
        <li class="parent ">
            <a href="#">
                <span class="glyphicon glyphicon-list"></span>
                分类 <span data-toggle="collapse" href="#sub-item-2" class="icon pull-right">
                    <em class="glyphicon glyphicon-s glyphicon-plus"></em>
                </span>
            </a>
            <ul class="children collapse" id="sub-item-2">
                <li style="margin-left:10%;"><input class="form-control" placeholder="创建分类" style="width: 200px" onblur="NewList(this)"></li>
                {volist name='group_list' id='vo'}
                <li>
                    <a class="" href="{:url('shop/Group/index',array('id'=>$vo['id']))}">
                        <span class="glyphicon glyphicon-share-alt"></span> {$vo.name}
                    </a>
                </li>
                {/volist}

            </ul>
        </li>
        <li ><a href="{:url('shop/recycle/index')}"><span class="glyphicon glyphicon-pencil"></span> 回收站</a></li>
    </ul>
    <div class="attribution"><a href="#" title="联系我们" target="_blank">联系我们</a></div>
</div><!--/.sidebar-->
{block name='body'}
body
{/block}
<script src="__HOME__/center/js/jquery-1.11.1.min.js"></script>
<script src="__HOME__/center/js/ZeroClipboard.js"></script>
<script src="__HOME__/center/js/bootstrap.min.js"></script>
<script src="__HOME__/center/js/bootstrap.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.11.1.min.js"><\/script>')</script>
<script src="__HOME__/center/js/fileinput.js" type="text/javascript"></script>
<!--简体中文-->
<script src="__HOME__/center/js/zh.js" type="text/javascript"></script>
<script>
    var ImgUrl = [];
    var Video_url = [];
    $('#file-zh').fileinput({
        language: 'zh',
        uploadUrl: '{:url("shop/upload/img_uploads")}',
        allowedFileExtensions: ['jpg', 'png', 'gif', 'jpeg'],
        maxFileCount: 5,
        msgFilesTooMany: "选择上传的文件数量 超过允许的最大数值！"
    }).on("fileuploaded", function (event, data, previewId, index) {
        console.log(index);
        if (data.response) {
            for (var i = 0; i <= index; i++) {
                ImgUrl[i] = data.response.img_url[0]
            }
            document.getElementById("ImgUrl").value = ImgUrl
        }
    });
    $('#file-video').fileinput({
        language: 'zh',
        uploadUrl: '{:url("shop/upload/video_upload")}',
        allowedFileExtensions : ['flv', 'swf', 'mkv', 'avi', 'rm', 'rmvb', 'mpeg', 'mpg', 'ogg', 'ogv', 'mov', 'wmv', 'mp4', 'webm', 'mp3'],
        maxFileCount: 1,
        msgFilesTooMany: "选择上传的文件数量 超过允许的最大数值！"
    }).on("fileuploaded", function (event, data, previewId, index) {
        if(data.response)
        {
            Video_url = data.response.img_url
        }
        document.getElementById("Video_url").value = Video_url
    });

    function NewList (e) {
        var title = $(e).val();
        if(title) {
            var url = "{:url('shop/group/add')}";
            $.post(url, {title: title}, function (res) {
                if(res.code == 1) {
                    window.location.reload();
                }else {
                    alert(res.msg);
                }
            });
        }
    }
    function search (e) {
        var title = $(e).val();
        var url = $(e).attr('data-url')+'/title/'+title;
        console.log(url);
        if(title) {
           window.location.href = url;
        }
    }

</script>
</body>

</html>